Skip to content

feat: GetExceptionsByReportDate #1495

Merged
Warren-Pitterson merged 34 commits intomainfrom
feat/DTOSS-10556-Exception-Reports
Sep 2, 2025
Merged

feat: GetExceptionsByReportDate #1495
Warren-Pitterson merged 34 commits intomainfrom
feat/DTOSS-10556-Exception-Reports

Conversation

@Warren-Pitterson
Copy link
Copy Markdown
Contributor

@Warren-Pitterson Warren-Pitterson commented Aug 19, 2025

Description

Added reportDate parameter with date validation
GetExceptionsByReportDate method filtering categories 12 (Confusion) and 13 (Superseded)
Added GetQueryParameterAsDateTime

Filter by Category & Date
image

Filter by Category
image

Filter by Date
image

All category 12 & 13 records

image

Context

https://nhsd-jira.digital.nhs.uk/browse/DTOSS-10556

Type of changes

  • Refactoring (non-breaking change)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I am familiar with the contributing guidelines
  • I have followed the code style of the project
  • I have added tests to cover my changes
  • I have updated the documentation accordingly
  • This PR is a result of pair or mob programming

Sensitive Information Declaration

To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.

  • I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.

…yReportDate logic, added GetQueryParameterAsDateTime in helper class,
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Aug 19, 2025

Unit Test Results

✔️ Tests 795 / 795 - passed in 63.6s
📝 Coverage 56.99%
📏 4286 / 7405 lines covered 🌿 1055 / 1966 branches covered
🔍 click here for more details

✏️ updated for commit 8459db2

@Warren-Pitterson Warren-Pitterson marked this pull request as ready for review August 27, 2025 00:28
@Warren-Pitterson
Copy link
Copy Markdown
Contributor Author

@chrimesdev queryParams are in the description, i've done some DEV testing with it, and all unit tests are passing

@chrimesdev chrimesdev requested a review from Copilot August 27, 2025 08:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds report-based filtering functionality for validation exceptions by implementing the GetExceptionsByReportDate method. The feature allows filtering exceptions by specific date ranges and categories (Confusion/Superseded).

  • Added GetReportExceptions method to filter validation exceptions by date and categories 12 (Confusion) and 13 (Superseded)
  • Implemented GetQueryParameterAsDateTime helper method with support for multiple date formats
  • Added comprehensive test coverage for various filtering scenarios

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
ValidationExceptionDataTests.cs Added test data and comprehensive test methods for report exception filtering scenarios
GetValidationExceptions.cs Enhanced function to handle report requests with date/category filtering and improved documentation
ValidationExceptionData.cs Implemented GetReportExceptions method with filtering logic for categories 12/13 and date ranges
IValidationExceptionData.cs Added interface method for GetReportExceptions
PaginationService.cs Refactored default ID selector with null-coalescing operators
IHttpParserHelper.cs Added interface method for DateTime parameter parsing
HttpParserHelper.cs Implemented GetQueryParameterAsDateTime with multiple format support and error logging

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@chrimesdev
Copy link
Copy Markdown
Member

Looking good, in the response is it possible to return the ExceptionDetails object as this contains the detail we need for the UI eg. Name, DoB, NHS number.

Warren-Pitterson and others added 2 commits September 1, 2025 08:35
- Move date filtering to database query to reduce memory usage
- Throw exception for null ID values instead of defaulting to 0
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Sep 1, 2025

@Warren-Pitterson
Copy link
Copy Markdown
Contributor Author

Looking good, in the response is it possible to return the ExceptionDetails object as this contains the detail we need for the UI eg. Name, DoB, NHS number.

Exception Details object has been added

@chrimesdev chrimesdev self-requested a review September 1, 2025 14:51
Copy link
Copy Markdown
Member

@chrimesdev chrimesdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Warren-Pitterson Warren-Pitterson added this pull request to the merge queue Sep 2, 2025
Merged via the queue into main with commit 7fe784f Sep 2, 2025
65 checks passed
@Warren-Pitterson Warren-Pitterson deleted the feat/DTOSS-10556-Exception-Reports branch September 2, 2025 08:36
stephhou pushed a commit that referenced this pull request Sep 5, 2025
* feat: added ReportDate Query Param, updated XML, added GetExceptionsByReportDate logic, added GetQueryParameterAsDateTime in helper class,

* test: GetExceptionsByReportDate Tests

* feat:  format provider added to helper method

* chore: sonarQube warnings and default value

* feat: isReport added, GetReportExceptions logic changed to filter by category and date correctly

* fix: default value already applied to helper method, removed

* test: tests added

* chore: renamed variable

* feat: abstract logic

* chore: XML docs

* chore: ternary operator formatting

* fix: logic error in GetReportExceptions

* fix: date fix

* fix: category logic fix

* refactor: refactor and tidy up GetReportExceptions method

* test: updated tests

* fix: improve query performance and null ID handling

- Move date filtering to database query to reduce memory usage
- Throw exception for null ID values instead of defaulting to 0

* chore: removed unused variable

* tests: update tests

* chore: tidy null check

* chore: removed unused variable

* feat: exception Details added, Pagination fixed for non reports,  GetReportExceptions refactor for details

* test: test date

* fix: renamed BuildNavigationHeaders to AddNavigationHeaders
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants